Repository navigation
Conversation
…sabled In a single accordion that is not collapsible, activating the trigger of the expanded item does nothing. The trigger still announced itself as an active, expanded button, so screen reader users had no signal that it could not be collapsed. The WAI-ARIA accordion pattern asks for aria-disabled="true" on that trigger. Set aria-disabled on the trigger when the item is expanded and the accordion is neither collapsible nor multiple. Disabled items keep the native disabled attribute only. The existing test that clicks the open trigger again now uses a forced click, since Playwright treats aria-disabled elements as not clickable. Fixes chakra-ui#3493 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: e5488b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 85 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
Thanks for the careful write-up and the PR, @jsabutis. The reference to the pattern is spot on. We've decided not to make this change for now:
If you need it in your app, you can add it yourself: <button {...api.getItemTriggerProps(item)} aria-disabled={locked || undefined} />I'll close this for now, but we're happy to revisit it if more people ask for it. Thanks again! 🙏 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3493
Description
In a single, non-collapsible accordion, the expanded item's trigger cannot collapse it, but it did not set
aria-disabled. The WAI-ARIA accordion pattern asks foraria-disabled="true"in that case.Current behavior
The expanded trigger announces as an active button, and activating it does nothing.
New behavior
aria-disabled="true"while its item is expanded and the accordion is neithercollapsiblenormultiple.disabledattribute.mainand passes with the fix.aria-disabledelements as not clickable.@zag-js/accordion.Is this a breaking change (Yes/No):
No
Additional Information
data-disabledis not set on the locked trigger, so styles keyed on it are unaffected. Styles keyed on[aria-disabled]would now match the open trigger.Accordion e2e tests pass on React (12 of 12). Typecheck, eslint and prettier pass on the changed files.